inherited fmCommonOut: TfmCommonOut
  Left = 548
  Top = 191
  Width = 945
  Height = 793
  Anchors = [akLeft, akTop, akRight]
  BorderIcons = [biSystemMenu, biMinimize]
  Caption = #1055#1077#1088#1077#1076#1072#1095#1072' '#1076#1077#1085#1077#1075
  Constraints.MinHeight = 793
  Constraints.MinWidth = 945
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  inherited sbBottom: TStatusBar
    Top = 739
    Width = 937
  end
  inherited Panel1: TPanel
    Width = 937
    Height = 41
    inherited BitBtn1: TBitBtn
      Left = 767
    end
    inherited BitBtn2: TBitBtn
      Left = 855
    end
  end
  object GroupBox1: TGroupBox [2]
    Left = 0
    Top = 41
    Width = 937
    Height = 232
    Align = alTop
    TabOrder = 2
    object Label5: TLabel
      Left = 8
      Top = 102
      Width = 26
      Height = 13
      Caption = #1044#1072#1090#1072
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label6: TLabel
      Left = 762
      Top = 107
      Width = 93
      Height = 13
      Caption = #1041#1072#1083#1072#1085#1089' '#1087#1086#1076#1086#1090#1095#1077#1090#1072
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label3: TLabel
      Left = 176
      Top = 105
      Width = 81
      Height = 13
      Caption = #1048#1089#1090#1086#1095#1085#1080#1082' '#1076#1077#1085#1077#1075
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object rgDo: TcxRadioGroup
      Left = 8
      Top = 24
      Caption = #1044#1077#1081#1089#1090#1074#1080#1077
      Properties.Items = <
        item
          Caption = #1055#1077#1088#1077#1076#1072#1095#1072' '#1076#1077#1085#1077#1075' '#1074' '#1073#1072#1085#1082
          Value = 0
        end
        item
          Caption = #1055#1077#1088#1077#1076#1072#1095#1072' '#1076#1077#1085#1077#1075' '#1076#1088#1091#1075#1086#1084#1091' '#1083#1080#1094#1091
          Value = 1
        end
        item
          Caption = #1042#1086#1079#1074#1088#1072#1090' '#1088#1086#1076#1080#1090#1077#1083#1103#1084
          Value = 2
        end>
      Properties.OnChange = rgDoPropertiesChange
      TabOrder = 0
      Height = 73
      Width = 785
    end
    object cxDBDateEdit1: TcxDBDateEdit
      Left = 8
      Top = 119
      DataBinding.DataField = 'RPDATE'
      DataBinding.DataSource = dsPC
      ParentFont = False
      Properties.DateButtons = [btnClear, btnToday]
      Properties.InputKind = ikMask
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -19
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.Shadow = True
      Style.IsFontAssigned = True
      TabOrder = 1
      Width = 153
    end
    object eBalance: TcxTextEdit
      Left = 761
      Top = 122
      TabStop = False
      ParentFont = False
      Properties.Alignment.Horz = taRightJustify
      Properties.ReadOnly = True
      Style.Color = clMoneyGreen
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -16
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.Shadow = True
      Style.IsFontAssigned = True
      TabOrder = 2
      Width = 142
    end
    object lcbFromWho: TcxLookupComboBox
      Left = 272
      Top = 122
      ParentFont = False
      Properties.KeyFieldNames = 'PID'
      Properties.ListColumns = <
        item
          Caption = #1060#1048#1054
          FieldName = 'PP'
        end
        item
          Caption = #1057#1090#1072#1090#1091#1089
          FieldName = 'SDNAME'
        end>
      Properties.ListSource = dsSotr1
      Properties.OnCloseUp = cxLookupComboBox2PropertiesCloseUp
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -16
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = []
      Style.Shadow = True
      Style.IsFontAssigned = True
      TabOrder = 3
      OnMouseDown = lcbFromWhoMouseDown
      Width = 481
    end
    object cbIzvne: TcxCheckBox
      Left = 269
      Top = 206
      Caption = #1055#1086#1089#1090#1091#1087#1083#1077#1085#1080#1077' '#1076#1077#1085#1077#1075' '#1080#1079#1074#1085#1077
      TabOrder = 4
      Width = 157
    end
    object Panel4: TPanel
      Left = 271
      Top = 162
      Width = 634
      Height = 38
      Caption = 'Panel3'
      Enabled = False
      TabOrder = 5
      DesignSize = (
        634
        38)
      object bAddJL: TcxButton
        Tag = 12
        Left = 548
        Top = 5
        Width = 77
        Height = 29
        Hint = #1044#1086#1073#1072#1074#1080#1090#1100' '#1095#1077#1083#1086#1074#1077#1082#1072
        Anchors = [akTop, akRight]
        Caption = #1070#1088'. '#1083#1080#1094#1086
        ParentShowHint = False
        ShowHint = True
        TabOrder = 0
        TabStop = False
        OnClick = bAddJLClick
        Glyph.Data = {
          76010000424D7601000000000000760000002800000020000000100000000100
          04000000000000010000CE0E0000D80E00001000000000000000000000000000
          80000080000000808000800000008000800080800000C0C0C000808080000000
          FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
          3333333333387F3333333333333333333333333333387F333333333333344333
          3333333333387F3333333333333443333333333333387F333333333333344333
          3333333333387F3333333333333443333333333333387F333333333333344333
          3333387FFFFFFFFFFFFF3344444444444433387777777F777777334444444444
          4433388888887F8888883333333443333333333333387F333333333333344333
          3333333333387F3333333333333443333333333333387F333333333333344333
          3333333333387F33333333333334433333333333333877333333333333333333
          3333333333388833333333333333333333333333333333333333}
        LookAndFeel.SkinName = ''
        NumGlyphs = 2
      end
      object lcbJL: TcxLookupComboBox
        Left = 7
        Top = 5
        ParentFont = False
        Properties.KeyFieldNames = 'JLID'
        Properties.ListColumns = <
          item
            Caption = #1070#1088#1080#1076'. '#1080#1084#1103
            FieldName = 'JLEGALNAME'
          end>
        Properties.ListSource = dsJL
        Properties.OnCloseUp = lcbJLPropertiesCloseUp
        Style.Font.Charset = DEFAULT_CHARSET
        Style.Font.Color = clWindowText
        Style.Font.Height = -16
        Style.Font.Name = 'Tahoma'
        Style.Font.Style = []
        Style.Shadow = True
        Style.IsFontAssigned = True
        TabOrder = 1
        OnMouseDown = lcbFromWhoMouseDown
        Width = 537
      end
    end
  end
  object Panel2: TPanel [3]
    Left = 0
    Top = 273
    Width = 937
    Height = 296
    Align = alTop
    TabOrder = 3
    Visible = False
    object Label2: TLabel
      Left = 9
      Top = 49
      Width = 92
      Height = 13
      Align = alCustom
      Caption = #1055#1086#1083#1091#1095#1072#1090#1077#1083#1100' '#1091#1089#1083#1091#1075
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label1: TLabel
      Left = 9
      Top = 1
      Width = 90
      Height = 13
      Align = alCustom
      Caption = #1050#1086#1084#1091' '#1074#1086#1079#1074#1088#1072#1097#1072#1077#1084
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object cxLookupComboBox1: TcxLookupComboBox
      Left = 8
      Top = 67
      ParentFont = False
      Properties.KeyFieldNames = 'PID'
      Properties.ListColumns = <
        item
          Caption = #1060#1048#1054
          FieldName = 'PP'
        end>
      Properties.ListSource = dsPoluchUslug
      Properties.OnChange = cxLookupComboBox1PropertiesChange
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -15
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = []
      Style.Shadow = True
      Style.IsFontAssigned = True
      TabOrder = 0
      OnMouseDown = lcbFromWhoMouseDown
      Width = 793
    end
    object dbgPeopleFind: TcxGrid
      Left = 9
      Top = 105
      Width = 920
      Height = 176
      Align = alCustom
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -13
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ParentFont = False
      TabOrder = 1
      LookAndFeel.Kind = lfStandard
      object tvPeopleFind: TcxGridDBTableView
        NavigatorButtons.ConfirmDelete = False
        NavigatorButtons.First.Visible = True
        NavigatorButtons.PriorPage.Visible = True
        NavigatorButtons.Prior.Visible = True
        NavigatorButtons.Next.Visible = True
        NavigatorButtons.NextPage.Visible = True
        NavigatorButtons.Last.Visible = True
        NavigatorButtons.Insert.Visible = False
        NavigatorButtons.Append.Visible = False
        NavigatorButtons.Delete.Visible = False
        NavigatorButtons.Edit.Visible = False
        NavigatorButtons.Post.Visible = False
        NavigatorButtons.Cancel.Visible = False
        NavigatorButtons.Refresh.Visible = False
        NavigatorButtons.SaveBookmark.Visible = False
        NavigatorButtons.GotoBookmark.Enabled = False
        NavigatorButtons.GotoBookmark.Visible = False
        NavigatorButtons.Filter.Visible = False
        FilterBox.CustomizeDialog = False
        FilterBox.Visible = fvNever
        DataController.DataSource = dsUsluga
        DataController.Summary.DefaultGroupSummaryItems = <>
        DataController.Summary.FooterSummaryItems = <
          item
            Format = '#,###0'
            Kind = skSum
            FieldName = 'DOSTUPNO'
            Column = tvPeopleFindDOSTUPNO
          end
          item
            Format = '#,###0'
            Kind = skSum
            FieldName = 'ZAPL'
            Column = tvPeopleFindZAPL
          end>
        DataController.Summary.SummaryGroups = <>
        DataController.Summary.Options = [soNullIgnore]
        OptionsBehavior.CellHints = True
        OptionsBehavior.FocusFirstCellOnNewRecord = True
        OptionsBehavior.IncSearch = True
        OptionsCustomize.ColumnFiltering = False
        OptionsCustomize.ColumnGrouping = False
        OptionsData.Appending = True
        OptionsData.Deleting = False
        OptionsData.Inserting = False
        OptionsView.NavigatorOffset = 5
        OptionsView.CellAutoHeight = True
        OptionsView.CellTextMaxLineCount = 3
        OptionsView.ColumnAutoWidth = True
        OptionsView.ExpandButtonsForEmptyDetails = False
        OptionsView.Footer = True
        OptionsView.GroupByBox = False
        OptionsView.HeaderEndEllipsis = True
        OptionsView.Indicator = True
        OptionsView.ShowColumnFilterButtons = sfbAlways
        Styles.Content = DMInv.cxData
        Styles.IncSearch = DMInv.cxGreenText
        Styles.Header = DMInv.cxSiniyText
        object tvPeopleFindSTNAME: TcxGridDBColumn
          Caption = #1059#1089#1083#1091#1075#1072
          DataBinding.FieldName = 'STNAME'
          Options.Editing = False
          Width = 339
        end
        object tvPeopleFindSUMMA_PLAT: TcxGridDBColumn
          Caption = #1042#1089#1077#1075#1086' '#1087#1086#1089#1090#1091#1087#1080#1083#1086
          DataBinding.FieldName = 'SUMMA_PLAT'
          Width = 113
        end
        object tvPeopleFindSUM_VOZVR: TcxGridDBColumn
          Caption = #1042#1086#1079#1074#1088#1072#1097'. '#1088#1086#1076#1080#1090'.'
          DataBinding.FieldName = 'SUM_VOZVR'
          Width = 113
        end
        object tvPeopleFindDOSTUPNO: TcxGridDBColumn
          Caption = #1044#1086#1089#1090#1091#1087#1085#1086
          DataBinding.FieldName = 'DOSTUPNO'
          Options.Editing = False
          Width = 78
        end
        object tvPeopleFindZAPL: TcxGridDBColumn
          Caption = #1057#1091#1084#1084#1072' '#1087#1077#1088#1077#1076#1072#1095#1080
          DataBinding.FieldName = 'ZAPL'
          PropertiesClassName = 'TcxCalcEditProperties'
          Properties.OnValidate = tvPeopleFindZAPLPropertiesValidate
          Styles.Content = DMInv.cxJoltiyFon
          Width = 84
        end
      end
      object dbgPeopleFindLevel1: TcxGridLevel
        GridView = tvPeopleFind
      end
    end
    object lcbPayer: TcxDBLookupComboBox
      Left = 8
      Top = 18
      DataBinding.DataField = 'PID'
      DataBinding.DataSource = dsPeopleCommon
      ParentFont = False
      Properties.DropDownRows = 15
      Properties.KeyFieldNames = 'PID'
      Properties.ListColumns = <
        item
          Caption = #1060#1048#1054
          FieldName = 'PP'
        end
        item
          Caption = #1057#1090#1072#1090#1091#1089
          FieldName = 'SDNAME'
        end
        item
          Caption = #1044#1072#1090#1072' '#1088#1086#1078#1076'.'
          Fixed = True
          FieldName = 'PDATEBIRTH'
        end>
      Properties.ListSource = dsPeople
      Properties.MaxLength = 0
      Properties.OnEditValueChanged = lcbPayerPropertiesEditValueChanged
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clBlack
      Style.Font.Height = -15
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = []
      Style.Shadow = True
      Style.IsFontAssigned = True
      TabOrder = 2
      OnMouseDown = lcbFromWhoMouseDown
      Width = 793
    end
  end
  object Panel3: TPanel [4]
    Left = 0
    Top = 569
    Width = 937
    Height = 72
    Align = alTop
    TabOrder = 4
    Visible = False
    object Label7: TLabel
      Left = 8
      Top = 15
      Width = 199
      Height = 13
      Caption = #1055#1086#1076#1086#1090#1095#1077#1090#1085#1086#1077' '#1083#1080#1094#1086' ('#1087#1086#1083#1091#1095#1072#1090#1077#1083#1100' '#1076#1077#1085#1077#1075')'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label4: TLabel
      Left = 508
      Top = 9
      Width = 60
      Height = 13
      Caption = #1057#1091#1084#1084#1072', '#1088#1091#1073'.'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label8: TLabel
      Left = 676
      Top = 9
      Width = 78
      Height = 13
      Caption = #1062#1077#1083#1100' '#1087#1077#1088#1077#1076#1072#1095#1080
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object edCSAMOUNT: TcxDBTextEdit
      Left = 505
      Top = 26
      DataBinding.DataField = 'RPSUMMA'
      DataBinding.DataSource = dsPC
      ParentFont = False
      Properties.IncrementalSearch = False
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -19
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.Shadow = True
      Style.IsFontAssigned = True
      TabOrder = 0
      Width = 143
    end
    object lcbToWho: TcxLookupComboBox
      Left = 8
      Top = 29
      ParentFont = False
      Properties.KeyFieldNames = 'PID'
      Properties.ListColumns = <
        item
          Caption = #1060#1048#1054
          FieldName = 'PP'
        end
        item
          Caption = #1057#1090#1072#1090#1091#1089
          FieldName = 'SDNAME'
        end>
      Properties.ListSource = dsSotr2
      Properties.OnCloseUp = lcbToWhoPropertiesCloseUp
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -16
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = []
      Style.Shadow = True
      Style.IsFontAssigned = True
      TabOrder = 1
      OnMouseDown = lcbFromWhoMouseDown
      Width = 481
    end
    object dbeTarget: TcxDBButtonEdit
      Left = 672
      Top = 27
      DataBinding.DataField = 'SDNAME'
      DataBinding.DataSource = dsPC
      ParentFont = False
      Properties.Buttons = <
        item
          Default = True
        end>
      Properties.OnButtonClick = dbeTargetPropertiesButtonClick
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -16
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = []
      Style.Shadow = True
      Style.IsFontAssigned = True
      TabOrder = 2
      OnMouseDown = lcbFromWhoMouseDown
      Width = 257
    end
  end
  object Panel_Note: TPanel [5]
    Left = 0
    Top = 641
    Width = 937
    Height = 88
    Align = alTop
    TabOrder = 5
    Visible = False
    object Label14: TLabel
      Left = 9
      Top = 11
      Width = 67
      Height = 13
      Align = alCustom
      Caption = #1050#1086#1084#1084#1077#1085#1090#1072#1088#1080#1081
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object cxDBMemo1: TcxDBMemo
      Left = 8
      Top = 32
      DataBinding.DataField = 'RPNOTE'
      DataBinding.DataSource = dsPC
      ParentFont = False
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -16
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = []
      Style.Shadow = True
      Style.IsFontAssigned = True
      TabOrder = 0
      Height = 49
      Width = 921
    end
  end
  object rgPlat: TcxRadioGroup [6]
    Left = 176
    Top = 159
    Properties.DefaultValue = 2
    Properties.Items = <
      item
        Caption = #1060#1080#1079'. '#1083#1080#1094#1086
        Value = 2
      end
      item
        Caption = #1070#1088'. '#1083#1080#1094#1086
        Value = 3
      end>
    Properties.ReadOnly = False
    Properties.OnChange = cxRadioGroup1PropertiesChange
    ItemIndex = 0
    TabOrder = 6
    Height = 80
    Width = 89
  end
  object dsPC: TDataSource
    DataSet = qPC
    Left = 144
    Top = 381
  end
  object qPC: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    CachedUpdates = True
    SQL.Strings = (
      'SELECT RP.*, SD.SDNAME'
      'FROM RASPRED_PODOTCH RP'
      'INNER JOIN SYS_DIC SD ON SD.SDID = RP.SDID'
      'WHERE RP.RPID = -1')
    UpdateObject = quPC
    GeneratorField.Field = 'RPID'
    GeneratorField.Generator = 'GEN_RASPRED_PODOTCH_ID'
    Left = 176
    Top = 381
    object qPCRPID: TIntegerField
      FieldName = 'RPID'
      Origin = '"RASPRED_PODOTCH"."RPID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPCRPDATE: TDateField
      FieldName = 'RPDATE'
      Origin = '"RASPRED_PODOTCH"."RPDATE"'
    end
    object qPCPPID: TIntegerField
      FieldName = 'PPID'
      Origin = '"RASPRED_PODOTCH"."PPID"'
    end
    object qPCRPSUMMA: TIBBCDField
      FieldName = 'RPSUMMA'
      Origin = '"RASPRED_PODOTCH"."RPSUMMA"'
      DisplayFormat = '#,###0'
      EditFormat = '0'
      Precision = 18
      Size = 2
    end
    object qPCRPUSERENTER: TIBStringField
      FieldName = 'RPUSERENTER'
      Origin = '"RASPRED_PODOTCH"."RPUSERENTER"'
      Size = 40
    end
    object qPCRPTIMEENTER: TDateTimeField
      FieldName = 'RPTIMEENTER'
      Origin = '"RASPRED_PODOTCH"."RPTIMEENTER"'
    end
    object qPCRPUSEREDIT: TIBStringField
      FieldName = 'RPUSEREDIT'
      Origin = '"RASPRED_PODOTCH"."RPUSEREDIT"'
      Size = 40
    end
    object qPCRPTIMEEDIT: TDateTimeField
      FieldName = 'RPTIMEEDIT'
      Origin = '"RASPRED_PODOTCH"."RPTIMEEDIT"'
    end
    object qPCPPID_TO: TIntegerField
      FieldName = 'PPID_TO'
      Origin = '"RASPRED_PODOTCH"."PPID_TO"'
    end
    object qPCRPTYPE: TIntegerField
      FieldName = 'RPTYPE'
      Origin = '"RASPRED_PODOTCH"."RPTYPE"'
    end
    object qPCRPISDELETE: TIntegerField
      FieldName = 'RPISDELETE'
      Origin = '"RASPRED_PODOTCH"."RPISDELETE"'
    end
    object qPCCSID: TSmallintField
      FieldName = 'CSID'
      Origin = '"RASPRED_PODOTCH"."CSID"'
    end
    object qPCRPNOTE: TIBStringField
      FieldName = 'RPNOTE'
      Origin = '"RASPRED_PODOTCH"."RPNOTE"'
      Size = 255
    end
    object qPCRPFORM: TIntegerField
      FieldName = 'RPFORM'
      Origin = '"RASPRED_PODOTCH"."RPFORM"'
    end
    object qPCBPID: TIntegerField
      FieldName = 'BPID'
      Origin = '"RASPRED_PODOTCH"."BPID"'
    end
    object qPCSDID: TIntegerField
      FieldName = 'SDID'
      Origin = '"RASPRED_PODOTCH"."SDID"'
    end
    object qPCSDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
  end
  object quPC: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  RPID,'
      '  RPDATE,'
      '  PPID,'
      '  RPSUMMA,'
      '  RPUSERENTER,'
      '  RPTIMEENTER,'
      '  RPUSEREDIT,'
      '  RPTIMEEDIT,'
      '  PPID_TO,'
      '  RPTYPE,'
      '  RPISDELETE,'
      '  CSID,'
      '  RPNOTE,'
      '  RPFORM,'
      '  BPID,'
      '  SDID'
      'from RASPRED_PODOTCH '
      'where'
      '  RPID = :RPID')
    ModifySQL.Strings = (
      'update RASPRED_PODOTCH'
      'set'
      '  BPID = :BPID,'
      '  CSID = :CSID,'
      '  PPID = :PPID,'
      '  PPID_TO = :PPID_TO,'
      '  RPDATE = :RPDATE,'
      '  RPFORM = :RPFORM,'
      '  RPID = :RPID,'
      '  RPISDELETE = :RPISDELETE,'
      '  RPNOTE = :RPNOTE,'
      '  RPSUMMA = :RPSUMMA,'
      '  RPTYPE = :RPTYPE,'
      '  SDID = :SDID'
      'where'
      '  RPID = :OLD_RPID')
    InsertSQL.Strings = (
      'insert into RASPRED_PODOTCH'
      
        '  (BPID, CSID, PPID, PPID_TO, RPDATE, RPFORM, RPID, RPISDELETE, ' +
        'RPNOTE, '
      '   RPSUMMA, RPTYPE, SDID)'
      'values'
      
        '  (:BPID, :CSID, :PPID, :PPID_TO, :RPDATE, :RPFORM, :RPID, :RPIS' +
        'DELETE, '
      '   :RPNOTE, :RPSUMMA, :RPTYPE, :SDID)')
    DeleteSQL.Strings = (
      'delete from RASPRED_PODOTCH'
      'where'
      '  RPID = :OLD_RPID')
    Left = 210
    Top = 382
  end
  object qPoluchUslug: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT P.PID, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,' +
        #39' '#39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      '    SD.SDNAME'
      'FROM PEOPLE P'
      'LEFT OUTER JOIN P_STATUS PS ON PS.PID = P.PID'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = PS.SDID'
      'WHERE P.PISDELETE IS NULL'
      '    AND PS.SDID = 1246'
      'ORDER BY 2')
    Left = 336
    Top = 325
    object qPoluchUslugPID: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPoluchUslugPP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object qPoluchUslugSDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
  end
  object dsPoluchUslug: TDataSource
    DataSet = qPoluchUslug
    Left = 296
    Top = 325
  end
  object dsUsluga: TDataSource
    DataSet = qUsluga
    Left = 296
    Top = 381
  end
  object qUsluga: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    BeforeOpen = qUslugaBeforeOpen
    CachedUpdates = True
    DataSource = dsPoluchUslug
    SQL.Strings = (
      
        'SELECT zapl.STNAME, zapl.SID, zapl.SCID, zapl.CTYPE, (zapl.summa' +
        '_plat - COALESCE(vozvr.sum_vozvr, 0)) AS dostupno,'
      'COALESCE(vozvr.sum_vozvr, 0) AS  sum_vozvr,'
      'zapl.summa_plat,'
      ' CAST ('#39'0'#39' AS INTEGER) AS zapl'
      'FROM'
      '('
      
        'SELECT IIF(C.CTYPE = 2, 12, S.SID) AS SID, IIF(C.CTYPE = 2, 12, ' +
        'S.SCID) AS SCID, C.CTYPE, IIF(C.CTYPE = 2,'#39' '#1055#1083#1072#1090#1072' '#1079#1072' '#1087#1077#1088#1077#1095#1080#1089#1083#1077#1085#1080 +
        #1077' '#1076#1077#1085#1077#1075' '#1085#1072' '#1088'/'#1089' '#1086#1073#1088#1072#1079#1086#1074#1072#1090#1077#1083#1100#1085#1086#1075#1086' '#1091#1095#1088#1077#1078#1076#1077#1085#1080#1103' '#1095#1077#1088#1077#1079' '#1073#1072#1085#1082#39', ST.STNAM' +
        'E) AS STNAME, SUM(C.CAMOUNT) AS summa_plat'
      'FROM COMMON_SERV CS'
      'INNER JOIN COMMON C ON C.CSID = CS.CSID'
      'INNER JOIN SPEC_COND SC ON SC.SCID = C.SCID'
      'INNER JOIN AGREEMENTS A ON A.AGID = SC.AGID '
      'INNER JOIN SERVICES S ON S.SCID = C.SCID'
      'INNER JOIN SERVICES_TYPE ST ON ST.STID = S.STID'
      'WHERE CS.PID_POLUCH = :PID'
      
        '        AND CS.CSISDELETE IS NULL AND SC.SCISDELETE IS NULL AND ' +
        'A.AGISDELETE IS NULL'
      '      AND CS.CSFORM = 0'
      '      AND CS.CSAMOUNT > 0'
      '      AND C.CTYPE < 2'
      'GROUP BY 1,2,3,4'
      ')  AS zapl'
      '--'#1082#1088#1086#1084#1077' '#1074#1086#1079#1074#1088#1072#1097#1077#1085#1085#1099#1093' '#1076#1077#1085#1077#1075' '#1088#1086#1076#1080#1090#1077#1083#1103#1084
      'LEFT OUTER JOIN'
      '('
      'SELECT S.SID, C.CTYPE, SUM(C.CAMOUNT) sum_vozvr'
      'FROM RASPRED_PODOTCH RP'
      'INNER JOIN COMMON_SERV CS ON CS.RPID = RP.RPID'
      'INNER JOIN COMMON C ON C.CSID = CS.CSID'
      'INNER JOIN SERVICES S ON S.SCID = C.SCID'
      'WHERE CS.CSISDELETE IS NULL'
      '   AND C.CTYPE = 3'
      '    AND RP.RPISDELETE IS NULL'
      '    AND CS.PID_POLUCH = :PID'
      'GROUP BY 1,2'
      ') AS vozvr ON vozvr.SID = zapl.SID')
    UpdateObject = quUsluga
    Left = 336
    Top = 381
    ParamData = <
      item
        DataType = ftInteger
        Name = 'PID'
        ParamType = ptUnknown
        Size = 4
      end
      item
        DataType = ftInteger
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object qUslugaSTNAME: TIBStringField
      FieldName = 'STNAME'
      ProviderFlags = []
      Size = 255
    end
    object qUslugaDOSTUPNO: TIBBCDField
      FieldName = 'DOSTUPNO'
      ProviderFlags = []
      DisplayFormat = '#,###0'
      EditFormat = '0'
      Precision = 18
      Size = 2
    end
    object qUslugaSID: TIntegerField
      FieldName = 'SID'
      Origin = '"SERVICES"."SID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qUslugaZAPL: TIntegerField
      FieldName = 'ZAPL'
      ProviderFlags = []
      DisplayFormat = '#,###0'
      EditFormat = '0'
    end
    object qUslugaCTYPE: TIntegerField
      FieldName = 'CTYPE'
      ProviderFlags = []
    end
    object qUslugaSUM_VOZVR: TIBBCDField
      FieldName = 'SUM_VOZVR'
      ProviderFlags = []
      DisplayFormat = '#,###0'
      Precision = 18
      Size = 2
    end
    object qUslugaSUMMA_PLAT: TIBBCDField
      FieldName = 'SUMMA_PLAT'
      ProviderFlags = []
      DisplayFormat = '#,###0'
      Precision = 18
      Size = 2
    end
    object qUslugaSCID: TIntegerField
      FieldName = 'SCID'
      ProviderFlags = []
    end
  end
  object dsPodotchLitso: TDataSource
    DataSet = qPodotchLitso
    Left = 144
    Top = 461
  end
  object qPodotchLitso: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      '--'#1095#1077#1083#1086#1074#1077#1082#1080
      
        'SELECT P.PID, P.PID as USERMONEY, PP.PPID, P.PLASTNAME||'#39' '#39'||SUB' +
        'STRING(P.PNAME FROM 1 FOR 1 )||'#39'. '#39'||'
      
        '        COALESCE(SUBSTRING(P.PPATRONYMIC FROM 1 FOR 1)||'#39'.'#39','#39' '#39')' +
        ' AS fio'
      'FROM  PERSON_PODOTCH PP'
      '--INNER JOIN USERMONEY UM ON UM.PID = PP.PP_ID'
      'INNER JOIN PEOPLE P ON P.PID = PP.PP_ID'
      'WHERE PP.PPTYPE = 4 and PP.PP_ID <> :PID')
    GeneratorField.Field = 'RPID'
    Left = 176
    Top = 461
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object qPodotchLitsoPPID: TIntegerField
      FieldName = 'PPID'
      Origin = '"PERSON_PODOTCH"."PPID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPodotchLitsoFIO: TIBStringField
      FieldName = 'FIO'
      ProviderFlags = []
      Size = 769
    end
  end
  object quUsluga: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  SID,'
      '  STNAME,'
      '  DOSTUPNO,'
      '  ZAPL'
      'from COMMON_SERV '
      'where'
      '  SID = :SID')
    ModifySQL.Strings = (
      'update COMMON_SERV'
      'set'
      '  DOSTUPNO = :DOSTUPNO,'
      '  SID = :SID,'
      '  STNAME = :STNAME,'
      '  ZAPL = :ZAPL'
      'where'
      '  SID = :OLD_SID')
    InsertSQL.Strings = (
      'insert into COMMON_SERV'
      '  (DOSTUPNO, SID, STNAME, ZAPL)'
      'values'
      '  (:DOSTUPNO, :SID, :STNAME, :ZAPL)')
    DeleteSQL.Strings = (
      'delete from COMMON_SERV'
      'where'
      '  SID = :OLD_SID')
    Left = 376
    Top = 385
  end
  object qPP_ID: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      'SELECT PP.PPID'
      'FROM PERSON_PODOTCH PP'
      'WHERE PP.PP_ID = :guserid AND PP.PPTYPE = :pptype')
    Left = 328
    Top = 437
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'guserid'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'pptype'
        ParamType = ptUnknown
      end>
    object qPP_IDPPID: TIntegerField
      FieldName = 'PPID'
      Origin = '"PERSON_PODOTCH"."PPID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
  end
  object qCS: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    AfterInsert = qCSAfterInsert
    CachedUpdates = True
    DataSource = dlgDS
    SQL.Strings = (
      'SELECT CS.* '
      'FROM COMMON_SERV CS'
      'WHERE CS.CSID = -100'
      '')
    UpdateObject = quCS
    GeneratorField.Field = 'CSID'
    GeneratorField.Generator = 'GEN_COMMON_SERV_ID'
    Left = 536
    Top = 88
    object qCSCSID: TIntegerField
      FieldName = 'CSID'
      Origin = '"COMMON_SERV"."CSID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qCSPID_POLUCH: TIntegerField
      FieldName = 'PID_POLUCH'
      Origin = '"COMMON_SERV"."PID_POLUCH"'
    end
    object qCSCSFORM: TIntegerField
      FieldName = 'CSFORM'
      Origin = '"COMMON_SERV"."CSFORM"'
    end
    object qCSCSAMOUNT: TIBBCDField
      FieldName = 'CSAMOUNT'
      Origin = '"COMMON_SERV"."CSAMOUNT"'
      Precision = 18
      Size = 2
    end
    object qCSCSDATE: TDateField
      FieldName = 'CSDATE'
      Origin = '"COMMON_SERV"."CSDATE"'
    end
    object qCSPID: TIntegerField
      FieldName = 'PID'
      Origin = '"COMMON_SERV"."PID"'
    end
    object qCSCSFORWHAT: TIBStringField
      FieldName = 'CSFORWHAT'
      Origin = '"COMMON_SERV"."CSFORWHAT"'
      Size = 255
    end
    object qCSCSNOTE: TIBStringField
      FieldName = 'CSNOTE'
      Origin = '"COMMON_SERV"."CSNOTE"'
      Size = 255
    end
    object qCSCSUSERENTER: TIBStringField
      FieldName = 'CSUSERENTER'
      Origin = '"COMMON_SERV"."CSUSERENTER"'
      Size = 40
    end
    object qCSCSTIMEENTER: TDateTimeField
      FieldName = 'CSTIMEENTER'
      Origin = '"COMMON_SERV"."CSTIMEENTER"'
    end
    object qCSCSUSEREDIT: TIBStringField
      FieldName = 'CSUSEREDIT'
      Origin = '"COMMON_SERV"."CSUSEREDIT"'
      Size = 40
    end
    object qCSCSTIMEEDIT: TDateTimeField
      FieldName = 'CSTIMEEDIT'
      Origin = '"COMMON_SERV"."CSTIMEEDIT"'
    end
    object qCSCSISDELETE: TIntegerField
      FieldName = 'CSISDELETE'
      Origin = '"COMMON_SERV"."CSISDELETE"'
    end
    object qCSCSDELETENOTE: TIBStringField
      FieldName = 'CSDELETENOTE'
      Origin = '"COMMON_SERV"."CSDELETENOTE"'
      Size = 255
    end
    object qCSCSNUMUSER: TIntegerField
      FieldName = 'CSNUMUSER'
      Origin = '"COMMON_SERV"."CSNUMUSER"'
    end
    object qCSJLID: TIntegerField
      FieldName = 'JLID'
      Origin = '"COMMON_SERV"."JLID"'
    end
    object qCSCSUSERMONEY: TIntegerField
      FieldName = 'CSUSERMONEY'
      Origin = '"COMMON_SERV"."CSUSERMONEY"'
    end
    object qCSBPID: TIntegerField
      FieldName = 'BPID'
      Origin = '"COMMON_SERV"."BPID"'
    end
    object qCSRPID: TIntegerField
      FieldName = 'RPID'
      Origin = '"COMMON_SERV"."RPID"'
    end
  end
  object quCS: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  CSID,'
      '  PID_POLUCH,'
      '  CSFORM,'
      '  CSAMOUNT,'
      '  CSDATE,'
      '  PID,'
      '  CSFORWHAT,'
      '  CSNOTE,'
      '  CSUSERENTER,'
      '  CSTIMEENTER,'
      '  CSUSEREDIT,'
      '  CSTIMEEDIT,'
      '  CSISDELETE,'
      '  CSDELETENOTE,'
      '  CSNUMUSER,'
      '  JLID,'
      '  CSUSERMONEY,'
      '  BPID,'
      '  RPID'
      'from COMMON_SERV '
      'where'
      '  CSID = :CSID')
    ModifySQL.Strings = (
      'update COMMON_SERV'
      'set'
      '  BPID = :BPID,'
      '  CSAMOUNT = :CSAMOUNT,'
      '  CSDATE = :CSDATE,'
      '  CSDELETENOTE = :CSDELETENOTE,'
      '  CSFORM = :CSFORM,'
      '  CSFORWHAT = :CSFORWHAT,'
      '  CSID = :CSID,'
      '  CSISDELETE = :CSISDELETE,'
      '  CSNOTE = :CSNOTE,'
      '  CSNUMUSER = :CSNUMUSER,'
      '  CSTIMEEDIT = :CSTIMEEDIT,'
      '  CSTIMEENTER = :CSTIMEENTER,'
      '  CSUSEREDIT = :CSUSEREDIT,'
      '  CSUSERENTER = :CSUSERENTER,'
      '  CSUSERMONEY = :CSUSERMONEY,'
      '  JLID = :JLID,'
      '  PID = :PID,'
      '  PID_POLUCH = :PID_POLUCH,'
      '  RPID = :RPID'
      'where'
      '  CSID = :OLD_CSID')
    InsertSQL.Strings = (
      'insert into COMMON_SERV'
      
        '  (BPID, CSAMOUNT, CSDATE, CSDELETENOTE, CSFORM, CSFORWHAT, CSID' +
        ', CSISDELETE, '
      
        '   CSNOTE, CSNUMUSER, CSTIMEEDIT, CSTIMEENTER, CSUSEREDIT, CSUSE' +
        'RENTER, '
      '   CSUSERMONEY, JLID, PID, PID_POLUCH, RPID)'
      'values'
      
        '  (:BPID, :CSAMOUNT, :CSDATE, :CSDELETENOTE, :CSFORM, :CSFORWHAT' +
        ', :CSID, '
      
        '   :CSISDELETE, :CSNOTE, :CSNUMUSER, :CSTIMEEDIT, :CSTIMEENTER, ' +
        ':CSUSEREDIT, '
      '   :CSUSERENTER, :CSUSERMONEY, :JLID, :PID, :PID_POLUCH, :RPID)')
    DeleteSQL.Strings = (
      'delete from COMMON_SERV'
      'where'
      '  CSID = :OLD_CSID')
    Left = 571
    Top = 88
  end
  object qPeopleCommon: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    AfterInsert = qPeopleCommonAfterInsert
    CachedUpdates = True
    SQL.Strings = (
      'SELECT PC.*'
      'FROM PEOPLE_COMMON PC'
      'WHERE PC.CSID = -1')
    UpdateObject = quPeopleCommon
    Left = 536
    Top = 120
    object qPeopleCommonPID: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE_COMMON"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
    end
    object qPeopleCommonCSID: TIntegerField
      FieldName = 'CSID'
      Origin = '"PEOPLE_COMMON"."CSID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
  end
  object quPeopleCommon: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  PID,'
      '  CSID'
      'from PEOPLE_COMMON '
      'where'
      '  CSID = :CSID and'
      '  PID = :PID')
    ModifySQL.Strings = (
      'update PEOPLE_COMMON'
      'set'
      '  CSID = :CSID,'
      '  PID = :PID'
      'where'
      '  CSID = :OLD_CSID and'
      '  PID = :OLD_PID')
    InsertSQL.Strings = (
      'insert into PEOPLE_COMMON'
      '  (CSID, PID)'
      'values'
      '  (:CSID, :PID)')
    DeleteSQL.Strings = (
      'delete from PEOPLE_COMMON'
      'where'
      '  CSID = :OLD_CSID and'
      '  PID = :OLD_PID')
    Left = 568
    Top = 120
  end
  object qCommons: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    CachedUpdates = True
    SQL.Strings = (
      'SELECT *'
      'FROM COMMON C'
      'WHERE C.CSID = -1')
    UpdateObject = quCommons
    GeneratorField.Field = 'CID'
    GeneratorField.Generator = 'GEN_COMMON_ID'
    Left = 536
    Top = 160
    object qCommonsCID: TIntegerField
      FieldName = 'CID'
      Origin = '"COMMON"."CID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qCommonsCSID: TIntegerField
      FieldName = 'CSID'
      Origin = '"COMMON"."CSID"'
    end
    object qCommonsCTYPE: TIntegerField
      FieldName = 'CTYPE'
      Origin = '"COMMON"."CTYPE"'
    end
    object qCommonsCAMOUNT: TIBBCDField
      FieldName = 'CAMOUNT'
      Origin = '"COMMON"."CAMOUNT"'
      Precision = 18
      Size = 2
    end
    object qCommonsCID_CORRECT: TIntegerField
      FieldName = 'CID_CORRECT'
      Origin = '"COMMON"."CID_CORRECT"'
    end
    object qCommonsCDATE: TDateField
      FieldName = 'CDATE'
      Origin = '"COMMON"."CDATE"'
    end
    object qCommonsCUSERENTER: TIBStringField
      FieldName = 'CUSERENTER'
      Origin = '"COMMON"."CUSERENTER"'
      Size = 40
    end
    object qCommonsCTIMEENTER: TDateTimeField
      FieldName = 'CTIMEENTER'
      Origin = '"COMMON"."CTIMEENTER"'
    end
    object qCommonsCUSEREDIT: TIBStringField
      FieldName = 'CUSEREDIT'
      Origin = '"COMMON"."CUSEREDIT"'
      Size = 40
    end
    object qCommonsCTIMEEDIT: TDateTimeField
      FieldName = 'CTIMEEDIT'
      Origin = '"COMMON"."CTIMEEDIT"'
    end
    object qCommonsSCID: TIntegerField
      FieldName = 'SCID'
      Origin = '"COMMON"."SCID"'
    end
  end
  object quCommons: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  CID,'
      '  CSID,'
      '  CTYPE,'
      '  CAMOUNT,'
      '  CID_CORRECT,'
      '  CDATE,'
      '  CUSERENTER,'
      '  CTIMEENTER,'
      '  CUSEREDIT,'
      '  CTIMEEDIT,'
      '  SCID'
      'from COMMON '
      'where'
      '  CID = :CID')
    ModifySQL.Strings = (
      'update COMMON'
      'set'
      '  CAMOUNT = :CAMOUNT,'
      '  CDATE = :CDATE,'
      '  CID = :CID,'
      '  CID_CORRECT = :CID_CORRECT,'
      '  CSID = :CSID,'
      '  CTIMEEDIT = :CTIMEEDIT,'
      '  CTIMEENTER = :CTIMEENTER,'
      '  CTYPE = :CTYPE,'
      '  CUSEREDIT = :CUSEREDIT,'
      '  CUSERENTER = :CUSERENTER,'
      '  SCID = :SCID'
      'where'
      '  CID = :OLD_CID')
    InsertSQL.Strings = (
      'insert into COMMON'
      
        '  (CAMOUNT, CDATE, CID, CID_CORRECT, CSID, CTIMEEDIT, CTIMEENTER' +
        ', CTYPE, '
      '   CUSEREDIT, CUSERENTER, SCID)'
      'values'
      
        '  (:CAMOUNT, :CDATE, :CID, :CID_CORRECT, :CSID, :CTIMEEDIT, :CTI' +
        'MEENTER, '
      '   :CTYPE, :CUSEREDIT, :CUSERENTER, :SCID)')
    DeleteSQL.Strings = (
      'null;')
    Left = 568
    Top = 161
  end
  object dsPeopleCommon: TDataSource
    DataSet = qPeopleCommon
    Left = 504
    Top = 121
  end
  object dsPeople: TDataSource
    DataSet = qPeople1
    Left = 488
    Top = 277
  end
  object qPeople1: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT P.*, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39' ' +
        #39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      '    SD.SDNAME, PS.SDID'
      'FROM PEOPLE P'
      'LEFT OUTER JOIN P_STATUS PS ON PS.PID = P.PID'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = PS.SDID'
      'WHERE P.PISDELETE IS NULL'
      'ORDER BY 3')
    Left = 560
    Top = 277
    object qPeople1PID: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPeople1PNAME: TIBStringField
      FieldName = 'PNAME'
      Origin = '"PEOPLE"."PNAME"'
      Size = 255
    end
    object qPeople1PLASTNAME: TIBStringField
      FieldName = 'PLASTNAME'
      Origin = '"PEOPLE"."PLASTNAME"'
      Size = 255
    end
    object qPeople1PPATRONYMIC: TIBStringField
      FieldName = 'PPATRONYMIC'
      Origin = '"PEOPLE"."PPATRONYMIC"'
      Size = 255
    end
    object qPeople1PDATEBIRTH: TDateField
      FieldName = 'PDATEBIRTH'
      Origin = '"PEOPLE"."PDATEBIRTH"'
    end
    object qPeople1PSEX: TIntegerField
      FieldName = 'PSEX'
      Origin = '"PEOPLE"."PSEX"'
    end
    object qPeople1PNOTE: TIBStringField
      FieldName = 'PNOTE'
      Origin = '"PEOPLE"."PNOTE"'
      Size = 2048
    end
    object qPeople1PUSERENTER: TIBStringField
      FieldName = 'PUSERENTER'
      Origin = '"PEOPLE"."PUSERENTER"'
      Size = 40
    end
    object qPeople1PTIMEENTER: TDateTimeField
      FieldName = 'PTIMEENTER'
      Origin = '"PEOPLE"."PTIMEENTER"'
    end
    object qPeople1PUSEREDIT: TIBStringField
      FieldName = 'PUSEREDIT'
      Origin = '"PEOPLE"."PUSEREDIT"'
      Size = 40
    end
    object qPeople1PTIMEEDIT: TDateTimeField
      FieldName = 'PTIMEEDIT'
      Origin = '"PEOPLE"."PTIMEEDIT"'
    end
    object qPeople1PISDELETE: TIntegerField
      FieldName = 'PISDELETE'
      Origin = '"PEOPLE"."PISDELETE"'
    end
    object qPeople1PP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object qPeople1SDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qPeople1SDID: TIntegerField
      FieldName = 'SDID'
      Origin = '"P_STATUS"."SDID"'
    end
  end
  object qPP: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    AfterInsert = qPPAfterInsert
    CachedUpdates = True
    SQL.Strings = (
      'SELECT PP.*'
      'FROM PERSON_PODOTCH PP'
      'WHERE PP.PPID = -1')
    UpdateObject = quPP
    GeneratorField.Field = 'PPID'
    GeneratorField.Generator = 'GEN_PERSON_PODOTCH_ID'
    Left = 368
    Top = 441
    object qPPPPID: TIntegerField
      FieldName = 'PPID'
      Origin = '"PERSON_PODOTCH"."PPID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPPPPTYPE: TIntegerField
      FieldName = 'PPTYPE'
      Origin = '"PERSON_PODOTCH"."PPTYPE"'
    end
    object qPPPP_ID: TIntegerField
      FieldName = 'PP_ID'
      Origin = '"PERSON_PODOTCH"."PP_ID"'
    end
  end
  object quPP: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  PPID,'
      '  PPTYPE,'
      '  PP_ID'
      'from PERSON_PODOTCH '
      'where'
      '  PP_ID = :PP_ID and'
      '  PPTYPE = :PPTYPE')
    ModifySQL.Strings = (
      'update PERSON_PODOTCH'
      'set'
      '  PP_ID = :PP_ID,'
      '  PPID = :PPID,'
      '  PPTYPE = :PPTYPE'
      'where'
      '  PP_ID = :OLD_PP_ID and'
      '  PPTYPE = :OLD_PPTYPE')
    InsertSQL.Strings = (
      'insert into PERSON_PODOTCH'
      '  (PP_ID, PPID, PPTYPE)'
      'values'
      '  (:PP_ID, :PPID, :PPTYPE)')
    DeleteSQL.Strings = (
      'delete from PERSON_PODOTCH'
      'where'
      '  PP_ID = :OLD_PP_ID and'
      '  PPTYPE = :OLD_PPTYPE')
    Left = 408
    Top = 441
  end
  object qSotr1: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT P.PID, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,' +
        #39' '#39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      '    SD.SDNAME, d.SDID'
      'FROM PEOPLE P'
      'INNER JOIN DOLJNOST_PEOPLE d ON d.PID = P.PID'
      'INNER JOIN DOLJNOST D1 ON d1.DOLID = d.DOLID'
      'INNER JOIN SYS_DIC SD ON SD.SDID = d1.SDID'
      'WHERE P.PISDELETE IS NULL AND d.DOLISDELETE IS NULL'
      
        'AND CURRENT_DATE BETWEEN D.DOLDATEBEGIN AND COALESCE(d.DOLDATEEN' +
        'D, CURRENT_DATE)'
      'UNION'
      'SELECT FIRST 1 NULL AS PID, NULL AS PP,'
      '    NULL AS SDNAME, NULL AS SDID'
      'FROM PEOPLE P'
      'ORDER BY 2'
      ''
      '')
    GeneratorField.Field = 'RPID'
    Left = 720
    Top = 69
    object qSotr1PID: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
    end
    object qSotr1PP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object qSotr1SDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qSotr1SDID: TIntegerField
      FieldName = 'SDID'
      Origin = '"P_STATUS"."SDID"'
    end
  end
  object dsSotr1: TDataSource
    DataSet = qSotr1
    Left = 688
    Top = 69
  end
  object qBalance: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      'SELECT SUM(sel.balance1) AS balance'
      'FROM'
      '('
      'SELECT  rp.rpsumma AS balance1'
      'FROM raspred_podotch rp'
      'INNER JOIN person_podotch pp ON pp.ppid = rp.ppid_to'
      'WHERE pp.pp_id = :pid AND'
      '      rp.rpisdelete IS NULL AND'
      '      pp.pptype = 4'
      '      AND rp.RPDATE >= :date'
      'UNION ALL'
      'SELECT'
      '       ((-1) * rp.rpsumma) AS balance1'
      'FROM raspred_podotch rp'
      'INNER JOIN person_podotch pp ON pp.ppid = rp.ppid'
      ''
      'WHERE pp.pp_id = :pid AND'
      '      rp.rpisdelete IS NULL AND'
      '      pp.pptype = 4'
      '      AND rp.RPDATE >= :date'
      ') AS sel')
    Left = 816
    Top = 56
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'pid'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'date'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'pid'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'date'
        ParamType = ptUnknown
      end>
    object qBalanceBALANCE: TIBBCDField
      FieldName = 'BALANCE'
      ProviderFlags = []
      Precision = 18
      Size = 2
    end
  end
  object qSotr2: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT P.PID, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,' +
        #39' '#39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      '    SD.SDNAME, d.SDID'
      'FROM PEOPLE P'
      'INNER JOIN DOLJNOST d ON d.PID = P.PID'
      'INNER JOIN SYS_DIC SD ON SD.SDID = d.SDID'
      'WHERE P.PISDELETE IS NULL AND d.DOLISDELETE IS NULL'
      
        'AND CURRENT_DATE BETWEEN D.DOLDATEBEGIN AND COALESCE(d.DOLDATEEN' +
        'D, CURRENT_DATE)'
      'UNION'
      'SELECT FIRST 1 NULL AS PID, NULL AS PP,'
      '    NULL AS SDNAME, NULL AS SDID'
      'FROM PEOPLE P'
      'ORDER BY 2')
    GeneratorField.Field = 'RPID'
    Left = 312
    Top = 525
    object qSotr2PID: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
    end
    object qSotr2PP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object qSotr2SDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qSotr2SDID: TIntegerField
      FieldName = 'SDID'
      Origin = '"P_STATUS"."SDID"'
    end
  end
  object dsSotr2: TDataSource
    DataSet = qSotr2
    Left = 280
    Top = 525
  end
  object dsJL: TDataSource
    DataSet = qJL
    Left = 656
    Top = 200
  end
  object qJL: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      'SELECT J.*'
      'FROM JURLITSA J'
      'where J.JLISDELETE is null')
    Left = 688
    Top = 200
    object qJLJLID: TIntegerField
      FieldName = 'JLID'
      Origin = '"JURLITSA"."JLID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qJLJLEGALNAME: TIBStringField
      DisplayWidth = 15
      FieldName = 'JLEGALNAME'
      Origin = '"JURLITSA"."JLEGALNAME"'
      Size = 255
    end
    object qJLJLNOTE: TIBStringField
      FieldName = 'JLNOTE'
      Origin = '"JURLITSA"."JLNOTE"'
      Size = 255
    end
    object qJLJLUSERENTER: TIBStringField
      FieldName = 'JLUSERENTER'
      Origin = '"JURLITSA"."JLUSERENTER"'
      Size = 40
    end
    object qJLJLTIMEENTER: TDateTimeField
      FieldName = 'JLTIMEENTER'
      Origin = '"JURLITSA"."JLTIMEENTER"'
    end
    object qJLJLUSEREDIT: TIBStringField
      FieldName = 'JLUSEREDIT'
      Origin = '"JURLITSA"."JLUSEREDIT"'
      Size = 40
    end
    object qJLJLTIMEEDIT: TDateTimeField
      FieldName = 'JLTIMEEDIT'
      Origin = '"JURLITSA"."JLTIMEEDIT"'
    end
    object qJLJLINN: TIBStringField
      DisplayWidth = 12
      FieldName = 'JLINN'
      Origin = '"JURLITSA"."JLINN"'
      Size = 12
    end
    object qJLJLOGRN: TIBStringField
      DisplayWidth = 12
      FieldName = 'JLOGRN'
      Origin = '"JURLITSA"."JLOGRN"'
      Size = 255
    end
    object qJLJLOPF: TIBStringField
      DisplayWidth = 5
      FieldName = 'JLOPF'
      Origin = '"JURLITSA"."JLOPF"'
      Size = 10
    end
    object qJLJLLEGALADRESS: TIBStringField
      DisplayWidth = 15
      FieldName = 'JLLEGALADRESS'
      Origin = '"JURLITSA"."JLLEGALADRESS"'
      Size = 255
    end
    object qJLJLCEONAME: TIBStringField
      FieldName = 'JLCEONAME'
      Origin = '"JURLITSA"."JLCEONAME"'
      Size = 255
    end
  end
end
